package com.ht.managermentserver.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import springfox.documentation.annotations.ApiIgnore;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author czy
 * @package com.ht.managermentserver.entity
 * @date 2020/6/4 14:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseEntity implements Serializable {

  public static final String VERSION = "version";
  public static final String DELETED = "deleted";
  public static final String CREATE_DATE = "create_date";
  public static final String UPDATE_DATE = "update_date";
  public static final String CREATE_ID = "create_id";
  public static final String UPDATE_ID = "update_id";


  @ApiModelProperty(value = "乐观锁-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT)
  @Version
  private Integer version;
  @ApiModelProperty(value = "是否删除 0 未删除 1删除-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT)
  @TableLogic
  private Boolean deleted;
  @ApiModelProperty(value = "创建时间-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT)
  private LocalDateTime createDate;
  @ApiModelProperty(value = "更新时间-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private LocalDateTime updateDate;
  @ApiModelProperty(value = "创建人-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT)
  private Long createId;
  @ApiModelProperty(value = "更新人-[系统处理,前端不用传值]",hidden = true)
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Long updateId;
}
